#! /bin/bash

# for the plot_data() function.
. /home/bmort/Thesis/spectCleanGui/scripts/plotting/plot_data.sh

# Titles
# ------------------------------------------------------------------------------
t1="Time Series"
t2="Dirty Spectrum"
t3="Spectral Window"
t4="Clean Spectrum"

# Axis labels
# ------------------------------------------------------------------------------
xL1="Time [s]"
xL2="Frequency [Hz]"
yL1="Signal Amplitude"
yL2="Amplitude"

# Plot even sampling
# ------------------------------------------------------------------------------
dir=`pwd`/even_sampling
pdir=${dir}/plots
time=${dir}/test_even.dat
dirty=${dir}/spectra/dirty_0.spect
window=${dir}/spectra/window_0.spect
clean=${dir}/spectra/clean_residual_0.spect

plot_data "t" $time ${pdir}/time       "$t1" "$xL1" "$yL1" 0.0 1.0
plot_data "s" $dirty ${pdir}/dirty     "$t2" "$xL2" "$yL2" 0.0 100.0
plot_data "s" $window ${pdir}/window   "$t3" "$xL2" "$yL2" 0.0 200.0
plot_data "s" $clean ${pdir}/clean     "$t4" "$xL2" "$yL2" 0.0 100.0


# Plot duty 20
# ------------------------------------------------------------------------------
dir=`pwd`/duty_20
pdir=${dir}/plots
time=${dir}/test_duty_20.dat
dirty=${dir}/spectra/dirty_0.spect
window=${dir}/spectra/window_0.spect
clean=${dir}/spectra/clean_residual_0.spect

plot_data "t" $time ${pdir}/time       "$t1" "$xL1" "$yL1" 0.0 1.0
plot_data "s" $dirty ${pdir}/dirty     "$t2" "$xL2" "$yL2" 0.0 100.0
plot_data "s" $window ${pdir}/window   "$t3" "$xL2" "$yL2" 0.0 200.0
plot_data "s" $clean ${pdir}/clean     "$t4" "$xL2" "$yL2" 0.0 100.0

# Plot random drops 80%
# ------------------------------------------------------------------------------
dir=`pwd`/random_drops_80
pdir=${dir}/plots
time=${dir}/test_random_drops_80.dat
dirty=${dir}/spectra/dirty_0.spect
window=${dir}/spectra/window_0.spect
clean=${dir}/spectra/clean_residual_0.spect

plot_data "t" $time ${pdir}/time       "$t1" "$xL1" "$yL1" 0.0 1.0
plot_data "s" $dirty ${pdir}/dirty     "$t2" "$xL2" "$yL2" 0.0 100.0
plot_data "s" $window ${pdir}/window   "$t3" "$xL2" "$yL2" 0.0 200.0
plot_data "s" $clean ${pdir}/clean     "$t4" "$xL2" "$yL2" 0.0 100.0

# Plot random times 41
# ------------------------------------------------------------------------------
dir=`pwd`/random_times_41
pdir=${dir}/plots
time=${dir}/test_random_times_41.dat
dirty=${dir}/spectra/dirty_0.spect
window=${dir}/spectra/window_0.spect
clean=${dir}/spectra/clean_residual_0.spect

plot_data "t" $time ${pdir}/time       "$t1" "$xL1" "$yL1" 0.0 1.0
plot_data "s" $dirty ${pdir}/dirty     "$t2" "$xL2" "$yL2" 0.0 100.0
plot_data "s" $window ${pdir}/window   "$t3" "$xL2" "$yL2" 0.0 200.0
plot_data "s" $clean ${pdir}/clean     "$t4" "$xL2" "$yL2" 0.0 100.0

